﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OnTheWay.Functions;
using Models;
using OnTheWay.Interfaces;
using LocalService;
using System.ComponentModel;
using System.Collections.ObjectModel;
using System.Windows;

namespace PcBackgroundMgr.Functions
{
    [DesignTimeVisible(false)]
    public class ExhibitListCtrl : FunctionCtrlList<Exhibit>
    {
        public ExhibitListCtrl()
            : this(null)
        {
        }

        public ExhibitListCtrl(Type type)
            : this(LocalFactory.ExhibitLocal, type)
        {
        }

        public ExhibitListCtrl(IObjectBasicBehaviors<Exhibit, Guid> domain, Type type)
            : base(domain,type)
        {
            this.mSqlOrder = "RegDate";
            this.PageSize = PageSizeItems[0];
        }

        //protected void ExhibitItemCtrl_OnDelete(object sender, RoutedEventArgs e)
        //{
        //    OnCommandDelete((sender as FrameworkElement).DataContext);
        //}

        //protected void ExhibitItemCtrl_OnModify(object sender, RoutedEventArgs e)
        //{
        //    OnCommandModify((sender as FrameworkElement).DataContext);
        //}

        //protected override void OnCommandRefreshFail(Exception ex)
        //{
        //    ObservableCollection<Exhibit> items = new ObservableCollection<Exhibit>();
        //    items.Add(new Exhibit() { Name = "测试数据1", MooMaUrl = "E:\\我的文档\\图片收藏\\非主流\\0b0b9e050b72993a1c95832a.jpg" });
        //    items.Add(new Exhibit() { Name = "测试数据2", MooMaUrl = "E:\\我的文档\\图片收藏\\非主流\\1_101024123418_7.jpg" });
        //    items.Add(new Exhibit() { Name = "测试数据3", MooMaUrl = "E:\\我的文档\\图片收藏\\非主流\\1_110106151801_1.jpg" });
        //    items.Add(new Exhibit() { Name = "测试数据4", MooMaUrl = "E:\\我的文档\\图片收藏\\非主流\\1_110106151801_3.jpg" });
        //    items.Add(new Exhibit() { Name = "测试数据5", MooMaUrl = "E:\\我的文档\\图片收藏\\非主流\\9b70af08901dd7982fddd460.jpg" });
        //    items.Add(new Exhibit() { Name = "测试数据6", MooMaUrl = "E:\\我的文档\\图片收藏\\非主流\\13_oh3vdw7tlqigy9wy.jpg" });
        //    items.Add(new Exhibit() { Name = "测试数据7", MooMaUrl = "E:\\我的文档\\图片收藏\\非主流\\CA8HWMFZ.jpg" });
        //    items.Add(new Exhibit() { Name = "测试数据8", MooMaUrl = "E:\\我的文档\\图片收藏\\非主流\\gfhfhjtf.jpg" });
        //    items.Add(new Exhibit() { Name = "测试数据9", MooMaUrl = "E:\\我的文档\\图片收藏\\非主流\\CA812LY3.jpg" });
        //    items.Add(new Exhibit() { Name = "测试数据0", MooMaUrl = "E:\\我的文档\\图片收藏\\非主流\\http_imgl45156.jpg" });
        //    items.Add(new Exhibit() { Name = "测试数据1", MooMaUrl = "E:\\我的文档\\图片收藏\\非主流\\psb.jpg" });
        //    DispatchItems = items;
        //}
    }
}
